﻿using System;//
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Globalization;
using System.Threading;
using FormattingLib;

namespace Test.Formatting
{ 
    [TestClass]
    public class NumberFormattingLegacyTest1
    {






        //GetFormattedWeight bei Schenker/Dachser/IntimeSlovakei/Kiala/Sernam/Logwin/GEL/PostSchweiz/
        //   TNT/TNTBelgien/TPS/Cargoline/PostAustria/NSE/PostlogisticsInnight
        [TestMethod]
        public void Schenker_Dachser_FormattedWeight_Test1()
        {
            double rounded;
            string formatted;
                                   
            formatted = LegacyFormatMethods.GetFormattedWeightSchenkerDachser(1.123);
            Assert.AreEqual("1123", formatted);

            rounded = NumberFormatting.GetRoundedNumber(1.123 * 1000, RoundingType.Round);
            formatted = NumberFormatting.GetFormattedNumber(rounded, "0", null, "{0:#}");
            Assert.AreEqual("1123", formatted);
            

            formatted = LegacyFormatMethods.GetFormattedWeightSchenkerDachser(1.567);
            Assert.AreEqual("1567", formatted);

            rounded = NumberFormatting.GetRoundedNumber(1.567 * 1000, RoundingType.Round);
            formatted = NumberFormatting.GetFormattedNumber(rounded, "0", null, "{0:#}");
            Assert.AreEqual("1567", formatted);


            formatted = LegacyFormatMethods.GetFormattedWeightSchenkerDachser(0.123);
            Assert.AreEqual("123", formatted);

            rounded = NumberFormatting.GetRoundedNumber(0.123 * 1000, RoundingType.Round);
            formatted = NumberFormatting.GetFormattedNumber(rounded, "0", null, "{0:#}");
            Assert.AreEqual("123", formatted);

        }




    }
}